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