UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1BpDXxbWbfm+/lRwL9w3LU+oMGgm2SDrpo8ulm2u6A=' 
WHERE 
  key_id = 'b47decfc7fbe748519fc1b20499432a6f24ec89e52437a3ffde9a957460188b1' 
  AND (
    token = '/1BpDXxbWbfm+/lRwL9w3LU+oMGgm2SDrpo8ulm2u6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029