UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm/VCMl01kepNOKD45e8MpoWtdLOlB3qOHXYJgx+NVjE=' 
WHERE 
  key_id = '10cde20bb420456fcc372cd3eb0b437db2e976bec118429544ec97616ccf24dc' 
  AND (
    token = 'm/VCMl01kepNOKD45e8MpoWtdLOlB3qOHXYJgx+NVjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033