UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37m47xdnSfrmgBb+t3q5bdg0N3pYZ0VH5j+hSGpH7BM='
WHERE
key_id = '8e2e5f2ab986dd772e8f6e7c3a0c4b24bbccfefcd58ebb1c5ee06440079b0f6a'
AND (
token = '37m47xdnSfrmgBb+t3q5bdg0N3pYZ0VH5j+hSGpH7BM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)