UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIsUH4oGhYrkWl2syz6rFOhtZVMjorfKuVPQx5iG/SA='
WHERE
key_id = 'da01b57ed75badbcb11424d791147663e2cc11f62633dc957a94a70d5b3e601c'
AND (
token = 'kIsUH4oGhYrkWl2syz6rFOhtZVMjorfKuVPQx5iG/SA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)