UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YwwJoC7wn6Me3DVOXbFz+XuOFYt7ipvVg1DFXSbY5Bw='
WHERE
key_id = 'bb51dfc82246457a970a071d2ead6e4a692cd030c5b8c7b6a7c2ca7c4d469661'
AND (
token = 'YwwJoC7wn6Me3DVOXbFz+XuOFYt7ipvVg1DFXSbY5Bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)