UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rWBqXM1LT8oCHMOVJ8s7tDVPMO5GshkpPsGC1RUdQnE=' 
WHERE 
  key_id = '0321fac0a66b6c28972a183336dff97bcd8aacc5ff31ed897f0ee9bf46d2c3fe' 
  AND (
    token = 'rWBqXM1LT8oCHMOVJ8s7tDVPMO5GshkpPsGC1RUdQnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025