UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fo/vvA6lIToN37XquWuusaTEDVce0g+bhi7fDhJ/Bpc=' 
WHERE 
  key_id = 'f4221ad6453eaf788bff8dbc098bd527f5ff8bf3b5045af740f1e1b383c8ad3d' 
  AND (
    token = 'fo/vvA6lIToN37XquWuusaTEDVce0g+bhi7fDhJ/Bpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036