UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6nGcK84uzB6RgLIDa5i+J0cTOapTezNRbZDtaMI5vSA='
WHERE
key_id = 'b4d9f4c931a81964e4cfa50d5d69511b81d8b71d1a16a3c58fc534d6ae1e9375'
AND (
token = '6nGcK84uzB6RgLIDa5i+J0cTOapTezNRbZDtaMI5vSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)