UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9acod8TA5Z9EXVtCXTDNrhJZYPSIEPeUZUNR/0ZN9IA=' 
WHERE 
  key_id = 'aee0e17a680a79a28c7652e1ee633766d3af94708dc71701d67746d3f5aca845' 
  AND (
    token = '9acod8TA5Z9EXVtCXTDNrhJZYPSIEPeUZUNR/0ZN9IA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028