UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '760hmWwFZ8uLj80MS/CaX39dnT54M8jPa/UIm3nsD/I=' 
WHERE 
  key_id = 'ec72da5a462aa380a6c8e5705fd6668d348b8b31e5a55ced3ad3e7de9032157f' 
  AND (
    token = '760hmWwFZ8uLj80MS/CaX39dnT54M8jPa/UIm3nsD/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040