UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77a1f8u4nIesb3kE1guCBCX3FT/pHA7bo2xCrhwBGvo=' 
WHERE 
  key_id = 'e5ba09fb55936e5d736e38a4eec6f9532b55f43ae22d85f8dcedb6591e2d0cd4' 
  AND (
    token = '77a1f8u4nIesb3kE1guCBCX3FT/pHA7bo2xCrhwBGvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059