UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QwwQkTe9PzNS9QJRciZ2WP2JUsxaQkYkcZ5dOiF3Ioo='
WHERE
key_id = 'b276c314df8f1a2dce4765c7169aa1222e38cad9a9e72c141554c86ce576752b'
AND (
token = 'QwwQkTe9PzNS9QJRciZ2WP2JUsxaQkYkcZ5dOiF3Ioo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)