UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gw3erRk6mYLEzcytfx5VM5e68bEES4T28PL5gPFLql0='
WHERE
key_id = 'db34a69897257d98aadd63cb774a26158e9ab5b19b33c7b5e8ba08e9ee11571b'
AND (
token = 'Gw3erRk6mYLEzcytfx5VM5e68bEES4T28PL5gPFLql0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)