UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jw0M6wm7oJ70057bL8gRXIMv5PMEvtauC24UBhB8PVY=' 
WHERE 
  key_id = '2c4979b99a4cb4a945b8f7364744de68ae98e2abd431024c39add5b92932a4ce' 
  AND (
    token = 'Jw0M6wm7oJ70057bL8gRXIMv5PMEvtauC24UBhB8PVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028