UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X7TrU0/B3oPtGxgQ3EGy11p1nnCi3siW0BP7A9+3r54='
WHERE
key_id = '5e1e9fdd9c4a153e19b9f9b408d1ec519b1255f2f392baa25238f08d3b939e80'
AND (
token = 'X7TrU0/B3oPtGxgQ3EGy11p1nnCi3siW0BP7A9+3r54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)