UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X8WOywz7x6Grup6Kt/uP8RV16WsQ88NDnySrngQWDgA='
WHERE
key_id = 'da5d3b80d2dcf09ddbcee012077c31e64a91bb662334491df06ab7795ac8eb60'
AND (
token = 'X8WOywz7x6Grup6Kt/uP8RV16WsQ88NDnySrngQWDgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)