UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kvCXA4SkdIJgP0GVdt/tL5N2HpMSfcSWta4s2XFsiaY='
WHERE
key_id = 'a284f7d126018b797a9013687fc614168ca2d0fa287677a5ddaa97f125f1ddf1'
AND (
token = 'kvCXA4SkdIJgP0GVdt/tL5N2HpMSfcSWta4s2XFsiaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)