UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ibj/Meiz56NCwG6gVMNBhUoOTVzhZ2FdzUcYGJmyayg='
WHERE
key_id = 'f2395fd53d2a681436ef8014f1edc4911fdc96caf0534f92a33ebf795b82b394'
AND (
token = 'ibj/Meiz56NCwG6gVMNBhUoOTVzhZ2FdzUcYGJmyayg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)