UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uEmwETNOS91KdcV04ho78+im2Q6iId8ZuzQULWTd97Q=' 
WHERE 
  key_id = '9d0f22979fe963370a2c9d82aa3889d0195fbb51e17c71743c77f9f85330f117' 
  AND (
    token = 'uEmwETNOS91KdcV04ho78+im2Q6iId8ZuzQULWTd97Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043