UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vT0cQacrg8Z5b4SaCXA/IjDwNf0Zy44urqLuMomeJE8='
WHERE
key_id = 'ada513cd8e3be916d44f2e4f142193557ac7ca9b39d4cd668279ee438ebe5940'
AND (
token = 'vT0cQacrg8Z5b4SaCXA/IjDwNf0Zy44urqLuMomeJE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)