UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mOsolf0OC+IRjWs1HrZ5+vjDERgZgnZSnyQ3mZiIFdI=' 
WHERE 
  key_id = '7fe266b51fb8a29d9004ce74bfb3635fb733dbbfb63bf3dea6cb906b690726f8' 
  AND (
    token = 'mOsolf0OC+IRjWs1HrZ5+vjDERgZgnZSnyQ3mZiIFdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031