UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/xUwisj6d1QYZgf2ww3BNp8zWVS5qwBSbDSJw67YPA='
WHERE
key_id = 'd227f49c58d2e01c02535aa4732cbe5c066f6e13443bf83efc67ee162721052c'
AND (
token = 't/xUwisj6d1QYZgf2ww3BNp8zWVS5qwBSbDSJw67YPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)