UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gqcfa/6WDvpS6VclfC3BZAnGiemm9tZOtitW1vfWTp8=' 
WHERE 
  key_id = '6f75ae20ffe1e0a27745129e06d7002a28420c1ec9e61886f8fdeae2431314bf' 
  AND (
    token = 'Gqcfa/6WDvpS6VclfC3BZAnGiemm9tZOtitW1vfWTp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083