UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rDX3sSD6IC/whh0qeU7v/a+yBvHR0Q1gBcjJw/pC8Zw='
WHERE
key_id = 'baaa7969f48348f8dee0a86b0f8e8fbc13c29b588fa51b572516ed2a220773c0'
AND (
token = 'rDX3sSD6IC/whh0qeU7v/a+yBvHR0Q1gBcjJw/pC8Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)