UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9k6b+8hwkHvxdE1RIDhmbT6eIrlv4x4He+OZx1qGfGA=' 
WHERE 
  key_id = '1c663f595efd30d5ebbc50cd86fafbf76ef50f888422045fd6d8750e88d710ac' 
  AND (
    token = '9k6b+8hwkHvxdE1RIDhmbT6eIrlv4x4He+OZx1qGfGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041