UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EV0Z+cCuC+Ae7jWk4o/8eM6ZQT1NzZZXb6t6CiLdiBc=' 
WHERE 
  key_id = '4cb9b3c821d440851dd5d8a02b5bac4b97b292761f2253a86aeead92e03069b0' 
  AND (
    token = 'EV0Z+cCuC+Ae7jWk4o/8eM6ZQT1NzZZXb6t6CiLdiBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017