UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7C/Hcyes8qO/nEEx2YSBcuLI8u1ulW2ynxoOHvvPwU='
WHERE
key_id = '237fa99e7f56d1f4c053c7f6a4e8624c8eb76b1d0e4a55b42bc4762153de3a9e'
AND (
token = 'i7C/Hcyes8qO/nEEx2YSBcuLI8u1ulW2ynxoOHvvPwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)