UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '66DJSPuvca1gjoJl7Ezs2DpoO0UpIAnjJCPzgfZ7+0o='
WHERE
key_id = 'b81f9400f1c12a612335b9ff83076be5476f15516bfb1a54379a6c3f7616579b'
AND (
token = '66DJSPuvca1gjoJl7Ezs2DpoO0UpIAnjJCPzgfZ7+0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)