UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i1CMVfC/zUAG3+g1Uul9LGXaC7Xuc3jhQwQgg6cCtJk='
WHERE
key_id = '0542dab98477fa62ef22aa4eb48a91f284311803119e5be586df5fe52a4a6e17'
AND (
token = 'i1CMVfC/zUAG3+g1Uul9LGXaC7Xuc3jhQwQgg6cCtJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)