UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EBS0EGqed1gaDv/O8IiAYQeBCIYgEmMKLJDQKR70jRg=' 
WHERE 
  key_id = '010f40bb4fa00f77411d00df6662a145a2351cac30f6a702e97b1b37df345afc' 
  AND (
    token = 'EBS0EGqed1gaDv/O8IiAYQeBCIYgEmMKLJDQKR70jRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030