UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U3c8EkTGCjtv5yXHIM9iTcltp/3ScEpMOuGK4TmK4bY='
WHERE
key_id = '252af77208a34e93ee5511a3d8ba88d18f6a7db53b2e0644d50cadcda45febf5'
AND (
token = 'U3c8EkTGCjtv5yXHIM9iTcltp/3ScEpMOuGK4TmK4bY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)