UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g6kccX0URszWEkRQnRik6T6obwASwn2odhtmguVuSgk='
WHERE
key_id = 'fa72fc6bdb43b7c5f047be132502ff10fce246bd9f5550d0bf4ff1dd2f3b26be'
AND (
token = 'g6kccX0URszWEkRQnRik6T6obwASwn2odhtmguVuSgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)