UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wjKjTlytorOdcS5F8eBGA4nsX98PjWuNpVUKa11blic='
WHERE
key_id = '0093d4b333b14aac4df8e13235dd344bc3c3b5bfaea30f2df86e7eb7b48a484e'
AND (
token = 'wjKjTlytorOdcS5F8eBGA4nsX98PjWuNpVUKa11blic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)