UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SENpA7Mc0Iuf6vPG2FIE1oa8dUWd1ZBz50FPUTor0zk='
WHERE
key_id = '19109015726b1215537716658347a33df6b0605a0e68de844182d231a445f9a2'
AND (
token = 'SENpA7Mc0Iuf6vPG2FIE1oa8dUWd1ZBz50FPUTor0zk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)