UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vdeeVmwmDncN4xz58xtrNjSpojUOv+LlfR4sk1JBOJU='
WHERE
key_id = 'c023d1c51cb0faacf6df8fd109f253e9ab1ba21229e7bc503773f40ba94cbab5'
AND (
token = 'vdeeVmwmDncN4xz58xtrNjSpojUOv+LlfR4sk1JBOJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)