UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'czzYhuiEWcxD6uyvNoFUMDHozsF/FFU4VJF1Cwk7gTE='
WHERE
key_id = 'a9537b264646913dd787fb308006b6e1180b53bffd720daf2f2eafcddb2e39a6'
AND (
token = 'czzYhuiEWcxD6uyvNoFUMDHozsF/FFU4VJF1Cwk7gTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)