UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ax/qx5rMg2ZSTF3D9x2lJujlzWakx24s02zUukcBjwk='
WHERE
key_id = 'ed2a32250380ad81054a7f66c4b3e5e0181b189fd97e6272d6dd4365dfc3e24b'
AND (
token = 'Ax/qx5rMg2ZSTF3D9x2lJujlzWakx24s02zUukcBjwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)