UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eeWXlj8VYHjCwW6I4Ld0LLHiNakVIezx9P8XoJFF1EA=' 
WHERE 
  key_id = 'b199422d74fc9c12e1e97fe6112fefc03d85e00b168d940d8091af8d34d1b4c2' 
  AND (
    token = 'eeWXlj8VYHjCwW6I4Ld0LLHiNakVIezx9P8XoJFF1EA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058