UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VJmwVxsD4wxexGiaVVDaaPQV2vFAyhP4PR9AmI4GUaQ='
WHERE
key_id = 'c0b5a0a6d2921fac821a759a2be212a1d22d90b60bdf397b2cc4f7726be57fa4'
AND (
token = 'VJmwVxsD4wxexGiaVVDaaPQV2vFAyhP4PR9AmI4GUaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)