UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VROnu5ymlxd3HDe+5QQVbMP9XB0eU0emfGCJ64Snf5I=' 
WHERE 
  key_id = '36ba479d05c5278769b77d640ef7069b3a5022c45bba80536ab7e90ed7c409dd' 
  AND (
    token = 'VROnu5ymlxd3HDe+5QQVbMP9XB0eU0emfGCJ64Snf5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042