UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HWzZbjEMTOrjSoiUB+E8dKEr6CEgxncbGlbSQkikihM='
WHERE
key_id = '5c97588490150ea179c5bd1d4d791b7d02a03e4119186e5964fa023ef45616d1'
AND (
token = 'HWzZbjEMTOrjSoiUB+E8dKEr6CEgxncbGlbSQkikihM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)