UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm1Ev0V+7SfUybLRduh4CYTBkR66Fs+zAvgfgiE6CD9M='
WHERE
key_id = '5e2264c708781df8cb975b4cd4b9966fc94a0f762c5a5392d16747fec1672c22'
AND (
token = 'm1Ev0V+7SfUybLRduh4CYTBkR66Fs+zAvgfgiE6CD9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)