UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4R2U7Do4yOd1HNm1lJfT2uNtc3h4SLdJbPm5Lji1Hp4=' 
WHERE 
  key_id = '25f57c19e1f61bd750d9d40552777d51071263df913feed4f07a2613b387628b' 
  AND (
    token = '4R2U7Do4yOd1HNm1lJfT2uNtc3h4SLdJbPm5Lji1Hp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031