UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v5ijnBFJo+T/x57YXcZHtCFRA9NMsFQqkfznGi7dR+A='
WHERE
key_id = '1c208ef79c649344ade1ed6d3f1dfaf170ed5f410e38c1f793c1f2987d2fc890'
AND (
token = 'v5ijnBFJo+T/x57YXcZHtCFRA9NMsFQqkfznGi7dR+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)