UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bTw+HTJsr7NtLwGCRl645pvTEGttyagNpuZ/Ga3AkiQ='
WHERE
key_id = '40841d272c0021ffbd1f61249ac052777fed495173276830a32300f2250fb2c9'
AND (
token = 'bTw+HTJsr7NtLwGCRl645pvTEGttyagNpuZ/Ga3AkiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)